<?php defined('SYSPATH') OR die('No direct access allowed.');?>
<!-- BEGIN PROFILE PAGE -->
<h2><?=Kohana::lang('auth.profile_title')?> <?=$user->username?></h2>
<dl class='usercard'>
	<dt>
		<?=$user->avatar()?>
	</dt>
	<dd>
		<h4><?=Kohana::lang('account.profile.username')?>: </h4>
		<p class="role_<?=$user->role?>"><?=$user->username?></p>
	</dd>
	<dd>
		<h4><?=Kohana::lang('account.profile.account_created')?>: </h4>
		<p><?=cmsformat::timestamp('main.dateonly', $user->created)?></p>
	</dd>
	<dd>
		<h4><?=Kohana::lang('account.profile.last_login')?>: </h4>
		<p><?=cmsformat::timestamp('main.dateonly', $user->last_login)?></p>
	</dd>
</dl>

<ol class="list userdata">
<?
	$userdata = array
	(
		'first_name'	=> 'fname',
		'last_name'		=> 'lname',
		'middle_name'	=> 'mname',
		'city'				=> 'city',
		'interests'		=> 'interests',
		'about'				=> 'about',
		'icq'					=> 'icq',
		'jabber'			=> 'jabber',
		'website'			=> 'website',
	);
	foreach($userdata as $field => $title):
	  if (is_null($user->user_detail->$field)) continue;
?>
    <li>
      <h4><?=Kohana::lang('account.'.$title.'.label')?>: </h4>
      <p><?=$user->user_detail->$field?></p>
    </li>
<?
	endforeach;
?>
</ol>
<!-- END PROFILE PAGE -->